﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Windows;
using System.Net;
namespace ZICMonitor
{
    class UpgradeCCF
    {
        public string CloseCCF()
        {
            Process ccfProcess = null;
            string ccfPath;
            foreach (Process process in Process.GetProcesses())
            {
                if (process.ProcessName.Contains("CCF"))
                {
                    ccfProcess = process;
                    break;
                }
            }
            if (ccfProcess != null)
            {
                MessageBoxResult confirmResult = MessageBox.Show(
                                "CCF2.0 需要升级到新的版本，请保存CCF2.0的现有操作",  "CCF2.0", MessageBoxButton.OKCancel);

                if (confirmResult != MessageBoxResult.OK)
                {
                    return null;
                }
                else
                {
                    ccfPath = ccfProcess.MainModule.FileName;
                    ccfProcess.Kill();
                    return ccfPath;
                }
            }
            //WebClient Client = new WebClient();
            //Client.DownloadFile("http://www.csharpfriends.com/Members/index.aspx", " index.aspx");

            return null;

        }

    }
}
